package com.thysdy.flowable.service;

import com.thysdy.flowable.entity.ProcessDefinition;
import com.thysdy.flowable.enums.CodeEnum;
import com.thysdy.flowable.exception.MyException;
import com.thysdy.flowable.flowable.BaseProcessService;
import com.thysdy.flowable.mapper.ProcessModelMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Transactional(rollbackFor = Exception.class)
@Service
public class ProcessModelService extends BaseProcessService {
    @Resource
    ProcessModelMapper processModelMapper;

    public List<ProcessDefinition> getProcessDefinitionList() throws MyException {
        List<ProcessDefinition> list = null;
        try {
            list = processModelMapper.getProcessDefinitionList();
        } catch (Exception e) {
            throw new MyException(CodeEnum.commonException);
        }
        return list;
    }
}
